<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<c:set var="contextRootPath" value="${pageContext.request.contextPath}" />
<c:if test="${pageContext.request.contextPath == '/'}">
	<c:set var="contextRootPath" value="" />
</c:if>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>GateWay请求日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css"
	href="${contextRootPath}/resource/easyui-themes/default/easyui.css" />
<link rel="stylesheet" type="text/css"
	href="${contextRootPath}/resource/easyui-themes/icon.css" />
<script language="javascript">
// 是否需要重新刷新页面
var g_needReloadPage = false;
</script>
<script type="text/javascript"
	src="${contextRootPath}/resource/js/jquery.easyui-1.4.min.js"></script>
</head>
<body>
<div>
	<span class="page_titile">GateWay请求日志</span> 
</div>
<form method="get" action="list.do" >
<table class="input_table" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="input_titile_td">查询日期</td>
		<td class="input_content_td">
			<input class="easyui-datebox" type="text" name="time" value="<c:out value='${time}' />" />
		</td>
		<td class="input_titile_td">开始时间</td>
		<td class="input_content_td">
			<input class="easyui-timespinner" type="text" name="start_time" value="<c:out value='${start_time}' />" />
			--
			<input class="easyui-timespinner" type="text" name="end_time" value="<c:out value='${end_time}' />" />
		</td>
		<td class="input_titile_td">方法</td>
		<td class="input_content_td">
			<input type="text" name="method" value="<c:out value='${method}' />" />
		</td>
	</tr>
	<tr>
		<td class="input_titile_td">手机号码</td>
		<td class="input_content_td">
			<input type="text" name="phone" value="<c:out value='${phone}' />" />
		</td>
		<td class="input_titile_td">业务请求标识</td>
		<td class="input_content_td">
			<input type="text" name="flow_id" value="<c:out value='${flow_id}' />" />
		</td>
		<td class="input_titile_td">app版本</td>
		<td class="input_content_td">
			<input type="text" name="app_version" value="<c:out value='${app_version}' />" />
		</td>
	</tr>
	<tr>
		<td class="input_titile_td">操作系统类型</td>
		<td class="input_content_td">
			<input type="text" name="os_type" value="<c:out value='${os_type}' />" />
		</td>
		<td class="input_titile_td">verify结果</td>
		<td class="input_content_td">
			<input type="text" name="verify_code" value="<c:out value='${verify_code}' />" />
		</td>
		<td class="input_titile_td">请求结果</td>
		<td class="input_content_td">
			<input type="text" name="result_code" value="<c:out value='${result_code}' />" />
		</td>
	</tr>
	<tr>
		<td class="input_titile_td">耗时</td>
		<td class="input_content_td">
			》= <input type="text" name="minCost" value="<c:out value='${minCost}' />" />
			《= <input type="text" name="maxCost" value="<c:out value='${maxCost}' />" />
		</td>
		<td class="input_content_td" align="center" colspan="4">
			<input type="submit" value=" 搜索 " />
		</td>
	</tr>
</table>
</form>

<form:form method="get" action="list.do" name="frmTurnPage1">
	<input type="hidden" name="time" value="<c:out value='${time}' />" />
	<input type="hidden" name="start_time" value="<c:out value='${start_time}' />" />
	<input type="hidden" name="end_time" value="<c:out value='${end_time}' />" />
	<input type="hidden" name="method" value="<c:out value='${method}' />" />
	<input type="hidden" name="phone" value="<c:out value='${phone}' />" />
	<input type="hidden" name="flow_id" value="<c:out value='${flow_id}' />" />
	<input type="hidden" name="app_version" value="<c:out value='${app_version}' />" />
	<input type="hidden" name="os_type" value="<c:out value='${os_type}' />" />
	<input type="hidden" name="verify_code" value="<c:out value='${verify_code}' />" />
	<input type="hidden" name="result_code" value="<c:out value='${result_code}' />" />
	<input type="hidden" name="minCost" value="<c:out value='${minCost}' />" />
	<input type="hidden" name="maxCost" value="<c:out value='${maxCost}' />" />
	
	<!-- 隐含变量 -->
	<jsp:include page="/WEB-INF/jsp/common/turnPage.jsp">
		<jsp:param name="formName" value="frmTurnPage1" />
	</jsp:include>
</form:form>

<form action="delRecords.do" 
	onsubmit="return Util.confirmSelectedCheckboxes(this, 'checkAll', '请选择要删除的 记录信息', '确认要删除这些 记录信息吗?');" >

<table class="records_table" align="center" cellspacing="0" cellpadding="0">
	<tr class="records_table_head" >		
		<td>id</td>
		<td>时间</td>
		<td>手机号码</td>
		<td>方法</td>
		<td>IP地址</td>
		<td>业务请求标识</td>
		<td>app版本</td>
		<td>请求结果</td>
		<td>耗时</td>
		<td>操作</td>
	</tr>
<c:forEach items="${pageData.resultList}" var="record">
	<tr class="records_table_record" >
		<td><c:out value="${record.id}" /></td>
		<td><fmt:formatDate value="${record.time}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
		<td><c:out value="${record.phone}" /></td>
		<td><c:out value="${record.method}" /></td>
		<td><c:out value="${record.ip}" /></td>
		<td><c:out value="${record.flow_id}" /></td>
		<td><c:out value="${record.app_version}" /></td>
		<td><c:out value="${record.result_code}" /></td>
		<td><c:out value="${record.cost}" /> ms</td>
		<td>
			<a href="javascript: g_needReloadPage = false; Util.popupIframeCenter('popupDiv', 600, 400, 'popupTitle', 'GateWay请求日志', 'popupIframe', 'show.do?id=<c:out value="${record.id}" />&time=<fmt:formatDate value="${record.time}" pattern="yyyy-MM-dd HH:mm:ss" />');">查看</a> 
		</td>
	</tr>
</c:forEach>
</table>

</form>

<form:form method="get" action="list.do" name="frmTurnPage2">
	<input type="hidden" name="time" value="<c:out value='${time}' />" />
	<input type="hidden" name="start_time" value="<c:out value='${start_time}' />" />
	<input type="hidden" name="end_time" value="<c:out value='${end_time}' />" />
	<input type="hidden" name="method" value="<c:out value='${method}' />" />
	<input type="hidden" name="phone" value="<c:out value='${phone}' />" />
	<input type="hidden" name="flow_id" value="<c:out value='${flow_id}' />" />
	<input type="hidden" name="app_version" value="<c:out value='${app_version}' />" />
	<input type="hidden" name="os_type" value="<c:out value='${os_type}' />" />
	<input type="hidden" name="verify_code" value="<c:out value='${verify_code}' />" />
	<input type="hidden" name="result_code" value="<c:out value='${result_code}' />" />
	<input type="hidden" name="minCost" value="<c:out value='${minCost}' />" />
	<input type="hidden" name="maxCost" value="<c:out value='${maxCost}' />" />
	
	<!-- 隐含变量 -->
	<jsp:include page="/WEB-INF/jsp/common/turnPage.jsp">
		<jsp:param name="formName" value="frmTurnPage2" />
	</jsp:include>
</form:form>

<div id='popupDiv' style="position:absolute;z-index:9999;width:300px;height:250;display:none;" class="popup_style" >
	<div class="close" onclick="javascript: $('#popupDiv').hide(); if (g_needReloadPage) location.reload();"></div>
    <div class="title"><h2 id="popupTitle"></h2></div>
    <div class="content"><iframe id="popupIframe" src="" frameborder="0" scrolling="auto" width="100%" height="100%"></iframe>
    </div>
</div>

</body>
</html>